﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Description;

namespace Pg.BioMedics.SDR.ServiceAgents
{
    /// <summary>
    /// Base abstract class for all external service agents
    /// </summary>
    public abstract class BaseServiceAgent
    {
        #region Fields

        private string endpointName;
        private ISecurityStrategy securityStrategy;

        #endregion

        #region Constructors

        /// <summary>
        /// Provides base service agnet initialization logic. 
        /// </summary>
        /// <param name="endpointName">Endpoint name</param>
        /// <param name="securityStrategy">Security strategy</param>
        protected internal BaseServiceAgent(string endpointName, ISecurityStrategy securityStrategy)
        {
            this.endpointName = endpointName;
            this.securityStrategy = securityStrategy;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets security strategy assigned to this service agent
        /// </summary>
        internal protected ISecurityStrategy SecurityStrategy
        {
            get
            {
                return this.securityStrategy;
            }
        }

        /// <summary>
        /// Gets / sets endpoint name
        /// </summary>
        internal protected string EndpointName
        {
            get
            {
                return this.endpointName;
            }
        }

        #endregion
    }
}
